﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SH.Common.CommonReturn;
using SH.Multitenant.API.Filters;
using SH.Multitenant.Application.IServices.IEmpRole;
using SH.Multitenant.Application.Services;

namespace SH.Multitenant.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class EmpRoleController : ControllerBase
    {
        private readonly IEmpRoleServices _empRoleServices;
        public EmpRoleController(IEmpRoleServices empRoleServices)
        {
            _empRoleServices = empRoleServices;
        }
        
        /// <summary>
        /// 员工角色修改
        /// </summary>
        /// <param name="empId"></param>
        /// <param name="roleId"></param>
        /// <returns></returns>
        [HttpPost]
        [LogActionFilter("Top", "员工角色修改")]
        public async Task<IActionResult> EmpRoleUpdAsync(string empId, int roleId)
        {
            var result = await _empRoleServices.EmpRoleUpdAsync(empId, roleId);
            return Ok(result);
        }
    }
}
